cls

$From = "ExchangeOp@ps.net"
$To = "david_f_ray@dell.com"
$SMTPHost = "162.135.4.20"
$Subject = "Hello Powershell Bo"
$Body =  "Sending mail is easy!"


$SmtpClient = New-Object System.Net.Mail.SmtpClient($SMTPHost) 
$MailMessage = New-Object System.Net.Mail.MailMessage($From, $To, $Subject, $Body)
$MailMessage.IsBodyHtml = $True
$MailMessage.Body = $Body
$StmpClient.Send($MailMessage)

Function sendmail($body)
{
    $SmtpClient = new-object system.net.mail.smtpClient 
    $MailMessage = New-Object system.net.mail.mailmessage 
    $SmtpClient.Host = $SMTPHost #"<Your Email Server>"
    $MailMessage.From = $From
    $MailMessage.To.add($To)
    $MailMessage.Subject = $Subject
	$MailMessage.IsBodyHtml = $True
    $MailMessage.Body = $body #Get-Content .\test.htm
	$SmtpClient.Send($mailmessage)
	# This will force the Garbage Collection Process
	[GC]::Collect()
}

#sendmail($body)
